/*
#
#  Copyright 2011 Matthew Jannace
#
#  This file is part of RoboCode BlackHoleAgent
#
#  RoboCode BlackHoleAgent is free software: you can redistribute it and/or
#  modify it under the terms of the GNU General Public License as
#  published by the Free Software Foundation, either version 3 of the
#  License, or (at your option) any later version.
#
#  RoboCode BlackHoleAgent is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#  General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with RoboCode BlackHoleAgent. If not, see
#  <http://www.gnu.org/licenses/>.
#
 */
package com.jannaceltd.TeamBlackHoleBeer;

/**
 * Abstract Class for extending to create a BlackHole Agent
 * @author Matthew Jannace <mjannace@gmail.com>
 * @version 1.0
 */
import com.jannaceltd.TeamBlackHoleBeer.Modules.HelperClasses.Enemy;
import com.jannaceltd.TeamBlackHoleBeer.Modules.Communication.Communication;
import com.jannaceltd.TeamBlackHoleBeer.Modules.CustomEvents.CustomEventProcessor;
import com.jannaceltd.TeamBlackHoleBeer.Modules.Targeting.Targeting;
import com.jannaceltd.TeamBlackHoleBeer.Modules.HelperClasses.TeamMate;
import com.jannaceltd.TeamBlackHoleBeer.Modules.Strategy.TeamStrategy;
import com.jannaceltd.TeamBlackHoleBeer.Modules.HelperClasses.VirtualBullets;
import com.jannaceltd.TeamBlackHoleBeer.Modules.Radar.Radar;
import com.jannaceltd.TeamBlackHoleBeer.Modules.Debug.Painting;
import com.jannaceltd.TeamBlackHoleBeer.Modules.Movement.Movement;
import java.awt.geom.Point2D;
import java.util.HashMap;
import robocode.TeamRobot;

public abstract class BlackHole_Abstract extends TeamRobot implements BlackHole_Interface {

    /**
     * HashMap to Track Enemies information
     */
    public HashMap<String, Enemy> enemies = null;
    /**
     * HashMap to Track teammates information
     */
    public HashMap<String, TeamMate> teamates = null;
    /**
     * HashMap to Track teammates Next Location information
     */
    public HashMap<String, TeamMate> teamatesNextLocation = null;
    /**
     * HashMap to Track teammate Friendly Fire information
     */
    public HashMap<String, VirtualBullets> friendlyFire = null;
    /**
     * HashMap to Track the Agents Fired bullets information
     */
    public HashMap<String, VirtualBullets> myFire = null;
    /**
     * The Enemy targeting for attack
     */
    public Enemy target = null;
    /**
     * Team Strategy Object
     */
    public TeamStrategy strategy = null;
    /**
     * Agent Movement Object
     */
    public Movement move = null;
    /**
     * Agent Radar Object
     */
    public Radar radar = null;
    /**
     * Agent Targeting Object
     */
    public Targeting gun = null;
    /**
     * Team Communication Object
     */
    public Communication comm = null;
    /**
     * Agent Event Processing Object
     */
    public CustomEventProcessor EventProcessor = null;
    /**
     * Agent Painting Object for debugging
     */
    public Painting paint = null;
    /**
     * The location of the centroid of the team
     */
    protected Point2D.Double centerMass = null;

    /**
     * Returns the Agents location as a Point2D.Double
     * @return Agents Location
     */
    public Point2D.Double getPos() {
        return new Point2D.Double(getX(), getY());
    }

    /**
     * Returns the Agents information as a Teammate object
     * @return Agents Information
     */
    public TeamMate getMyInfo() {
        return new TeamMate(
                /* Name = */getName(),
                /* Energy = */ getEnergy(),
                /* Alive = */ true,
                /* Position = */ new Point2D.Double(getX(), getY()),
                /* Bearing = */ 0.0,
                /* Heading = */ getHeadingRadians(),
                /* Velocity = */ getVelocity(),
                /* Distance = */ 0.0,
                /* ChangeHeading = */ 0.0,
                /* Velocity = */ getTime());
    }

    /**
     * gets the Center of Mass of the team (centroid)
     * @return centerMass
     */
    public Point2D.Double getCenterMass() {
        return centerMass;
    }

    /**
     * Sets the Center of Mass of the team (centroid)
     * @param CenterMass 
     */
    public void setCenterMass(Point2D.Double CenterMass) {
        this.centerMass = CenterMass;
    }
}
